var estados = {
		init:function(){
			$('#estados').jqGrid({
	           url:'estados/index',
	           datatype:'json',
	           mtype:'POST',
	           colNames:['id','Descripcion','Creado'],
	           colModel:[
	               {name:"data[Estado][id]",hidden:true},
	               {name:"data[Estado][descripcion]",index:'Estado.descripcion',width:250,align:'left',sortable:true,editable:true,editoptions:{maxlength:20, size:25},editrules:{required:true},searchoptions:{sopt:['cn','eq','ne','lt','le','gt','ge','bw','ew']}},
	               {name:"data[Estado][created]",index:'Estado.created',width:60,align:'left',sortable:true,editable:false,searchoptions:{sopt:['cn','eq','ne','lt','le','gt','ge','bw','ew']}},	                              
	           ],
			  
			   pager:$('#estados-pager'),
	           rowNum:10,
	           rownumbers: true, 
	           rowList:[10,20,30],
	           mtype: "POST",
	           viewrecords:true,
	           caption:'Estados',
	           height:'180',
	           sortname: "Estado.descripcion",
	           editurl: 'estados/index'
	          
	                
	       });
	       $('#estados').navGrid("#estados-pager",
		   	{edit:true,add:true,del:true},
				{clearAfterEdit:false,reloadAfterSubmit:true, closeOnEscape:true},
				{clearAfterAdd:false,reloadAfterSubmit:true, closeOnEscape:true},
		   		{width:270,reloadAfterSubmit:true, closeOnEscape:true},
				{sopt:['cn','eq','ne','lt','le','gt','ge','bw','ew'],multipleSearch:true, closeOnEscape:true});
	       $("#estados").jqGrid('filterToolbar',{stringResult: true,searchOnEnter : false});
	       jQuery("#estados").jqGrid('setGridWidth',$('#RightPane').width()-50);
		}
};